package com.xdclass.user.controller;

import com.xdclass.user.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 薛虎
 * @date 2021/1/12 17:39
 */
@RestController
public class UserController {

    //引用服务类来自服务提供者
    @Reference(version = "1.0.0", url = "dubbo://127.0.0.1:12345")
//    @Reference(version = "1.0.0")
    private UserService userService;

    @RequestMapping("/sayHello")
    public String sayHello() {
        return userService.sayHello();
    }
}
